package org.aeon.fasttasks.core.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

/**
 * @author aeon
 * @createTime 2025/08/11  17:05
 * @description
 */
public class Collections {

    /**
     * 将数组添加到集合中
     *
     * @param collection
     * @param items
     * @param <T>
     * @return
     */
    @SafeVarargs
    public static <T> Collection<T> of(Collection<? extends T> collection, T... items) {
        Collection<T> list;
        if (collection == null) {
            list = new ArrayList<>();
        } else {
            list = new ArrayList<>(collection);
        }
        list.addAll(Arrays.asList(items));
        return list;
    }

}
